import React from 'react';
import { RouteObject } from 'react-router-dom';
import { DashboardOutlined } from '@ant-design/icons';
import Layout from '@/layouts/Layout';
import Dashboard from '@/pages/admin/Dashboard';
import AdminHome from '@/pages/admin/Home';
import SystemMonitor from '@/pages/monitor/SystemMonitor';
import NotFound from '@/pages/error/NotFound';

export interface AppRoute extends Omit<RouteObject, 'children'> {
    auth?: boolean;
    icon?: React.ReactNode;
    name?: string;
    children?: AppRoute[];
}

export const routes: AppRoute[] = [
    {
        path: '/',
        element: <Layout />,
        auth: true,
        children: [
            {
                path: 'admin',
                element: <Dashboard />,
                name: '管理控制台',
                icon: <DashboardOutlined />,
                auth: true,
                children: [
                    {
                        path: '',
                        element: <AdminHome />,
                        name: '仪表板',
                    },
                    {
                        path: 'monitor',
                        element: <SystemMonitor />,
                        name: '系统监控',
                    },
                ],
            },
        ],
    },
    {
        path: '*',
        element: <NotFound />,
    },
]; 